#!/bin/bash
# pattern.sh - Demonstrate pattern matching operators

MYFILE=/usr/src/linux/Documentation/ide.txt

echo 'MYFILE = '${MYFILE}
echo '${MYFILE##*/} = '${MYFILE##*/}                    # 这里*/两个字符是一个整体，*号为通配符
echo 'basename ${MYFILE} = '$(basename ${MYFILE})       # 调用命令返回的字符串，用$(命令 ${命令的参数字符串})
echo '${MYFILE%/*} = '${MYFILE%/*}
echo 'dirname ${MYFILE} ='$(dirname ${MYFILE})
